<?php
/**
 */
class MessageIntensityTable extends Doctrine_Table
{
	public function getTotalColors()
	{
			$query=new Doctrine_Query();
		    $query->select('count(id) as numCount')
		       ->from('MessageIntensity e');
			     //echo $query;exit;
			   	$result = $query->execute();
				return $result[0];
				
		
	}
	public function getColors()
	{
			$query=new Doctrine_Query();
		    $query->select('e.*')
		       ->from('MessageIntensity e');
			     //echo $query->getSqlQuery();exit;
			   	$result = $query->execute(array(),Doctrine::HYDRATE_ARRAY);
				//echo '<pre>';print_r($result);exit;
				return $result;
				
				
				
		
	}
	public function getColorsById($color_id)
	{

			    //	echo $username." ".$password;exit;
	        $query=new Doctrine_Query();
		    $query->select('m.message_intensity as intensity,m.desc as desc')
		       ->from('MessageIntensity m')
			   ->where("m.id='".$color_id."'");
			      //echo $query;exit;
			   	$result = $query->execute(array(),Doctrine::HYDRATE_ARRAY);
				//echo '<pre>';print_r($result);exit;
				return $result[0];
	}
}